package com.mars.logger.dto;

import java.util.Date;

import org.apache.commons.lang3.StringUtils;

import com.mars.base.common.utils.date.DateUtil;
import com.mars.logger.entity.LoggerLogin;

public class LoggerLoginDto extends LoggerLogin {

	private static final long serialVersionUID = 1L;

	/**
	 * 日期范围：2014-04-12 - 2015-01-30
	 */
	private String[] daterange;

	/**
	 * 开始日期
	 */
	private Date startDate;

	/**
	 * 结束日期
	 */
	private Date endDate;
	
	private int page;

	private int rows;
	
	private String orderByLogin ;

	public String getOrderByLogin() {
		return orderByLogin;
	}

	public void setOrderByLogin(String orderByLogin) {
		this.orderByLogin = orderByLogin;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String[] getDaterange() {
		return daterange;
	}

	public void setDaterange(String[] daterange) {
		this.daterange = daterange;
	}

	public Date getStartDate() {
		if(null != this.daterange && daterange.length > 0) {
			if(StringUtils.isNotBlank(this.daterange[0].toLowerCase())) {
				startDate = DateUtil.parseDate(this.daterange[0]) ;
			}
		}
		return startDate;
	}

	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	public Date getEndDate() {
		if(null != this.daterange && daterange.length > 0) {
			if(StringUtils.isNotBlank(this.daterange[1].toLowerCase())) {
				endDate = DateUtil.parseDate(this.daterange[1]) ;
			}
		}
		return endDate;
	}

	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}

}
